- 
                Notifications
    You must be signed in to change notification settings 
- Fork 110
Compact canonical constructor support #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compact canonical constructor support #484
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally this looks good! I just have one small comment here. We could also hide canonical constructors that have no code other than the field assignments, but we can do that later.
| return !hideMethod; | ||
| } | ||
|  | ||
| private static int getParamCount(StructMethod mt, TextBuffer buffer, int indent, MethodWrapper methodWrapper, MethodDescriptor md, boolean isEnum, boolean init, boolean thisVar, GenericMethodDescriptor descriptor, int paramCount, boolean isInterface, int flags, StructClass cl) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could use a slightly more descriptive name, since it has side effects as well as returning the param count.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Yeah, this was certainly not the correct name.
| 
 We do that already, there is one place that doesn't occur and that's because there is an annotation on the constructor. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks a lot!
Minecraft diff
Would love feedback on the method pruning, not sure if there is a prefered way I should be doing this.
Additionally, I have to store a flag that a method wrapper is a compact constructor as I prune the fields making the check no longer valid later in the code.